<template>
  <div class="app-container">
    <div class="box_main"></div>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  created() {},
  methods: {}
};
</script>

<style lang="scss" scoped>
.box_main {
  width: 100px;
  height: 100px;
  background: red;
  position: relative;
  animation: myfirst 8s infinite reverse;
}

@keyframes myfirst {
  
  100% {
    background: red;
    left: 100%;
    top: 0px;
  }

  0% {
    background: red;
    left: 0px;
    top: 0px;
  }

  //  50% {
  //   background: red;
  //   left: 50%;
  //   top: 0px;
  // }



}
//鼠标划过停止动画效果
.box_main:hover {
  -webkit-animation-play-state: paused;
  animation-play-state: paused;
}

</style>